import request from '@/utils/request'

// 查询配置列表
export function listConfig(query) {
  return request({
    url: '/activity/red/config/list',
    method: 'get',
    params: query
  })
}

// 查询红包配置
export function getRedPacketConfig(id) {
  return request({
    url: '/activity/red/config/' + id,
    method: 'get'
  })
}

// 修改角色
export function updateConfig(data) {
  return request({
    url: '/activity/red/config',
    method: 'put',
    data: data
  })
}

// 新增角色
export function addConfig(data) {
  return request({
    url: '/activity/red/config',
    method: 'post',
    data: data
  })
}

// 删除配置
export function delConfig(id) {
  return request({
    url: '/activity/red/config/' + id,
    method: 'delete'
  })
}

export function getParameters() {
  return request({
    url: '/activity/red/limit/parameter/all',
    method: 'get'
  })
}

export function getParametersById(id) {
  return request({
    url: '/activity/red/limit/parameter/little/'+id,
    method: 'get'
  })
}
